//package com.spzx.product;
//
//import com.spzx.common.security.config.ThreadPoolUtil;
//import org.ehcache.xml.model.ThreadPoolsType;
//
//import java.util.concurrent.CompletableFuture;
//import java.util.concurrent.ExecutionException;
//import java.util.concurrent.ThreadPoolExecutor;
//
//public class SpzxCompletableFuture {
//
//    public static void main(String[] args) throws ExecutionException, InterruptedException {
//        CompletableFuture<Void> f1 = CompletableFuture.runAsync(() -> {
//            try {
//                Thread.sleep(3000);
//            } catch (InterruptedException e) {
//                throw new RuntimeException(e);
//            }
//            System.out.println(Thread.currentThread().getName() + " 执行了任务1");
//
//        }, ThreadPoolUtil.threadPoolExecutor());
//
//
//        CompletableFuture<String> f2 = CompletableFuture.supplyAsync(() -> {
//            System.out.println(Thread.currentThread().getName() + " 执行了任务2");
//            return "hehe";
//
//        }, ThreadPoolUtil.threadPoolExecutor());
//
//        System.out.println(f1.get());
//        System.out.println(f2.get());
//
//
//    }
//
//
//
//
//}
